/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gtree;

import java.util.ArrayList;
import no.geosoft.cc.graphics.GObject;

/**
 *
 * @author grostirolla
 */
public class Node extends GObject implements Position {

    private Node parent;
    private String element;
    private ArrayList<Node> children;
    private double x_, y_;

    public Node(Node previous, String element) {
        this.parent = previous;
        this.element = element;
        this.children = new ArrayList<Node>();
    }

    public Node(Node previous, String element, double x, double y) {
        this.parent = previous;
        this.element = element;
        this.children = new ArrayList<Node>();
        this.x_ = x;
        this.y_ = y;
    }

    @Override
    public String toString() {
        return "Element: " + getElement();
    }

    /**
     * @return the parent
     */
    public Node getParentNode() {
        return parent;
    }

    /**
     * @param parent the parent to set
     */
    public void setParent(Node parent) {
        this.parent = parent;
    }

    /**
     * @return the element
     */
    public String getElement() {
        return element;
    }

    /**
     * @param element the element to set
     */
    public void setElement(String element) {
        this.element = element;
    }

    /**
     * @return the children
     */
    public ArrayList<Node> getChildren() {
        return children;
    }

    /**
     * @param children the children to set
     */
    public void setChildren(ArrayList<Node> children) {
        this.children = children;
    }

    public double getX() {
        return x_;
    }

    public double getY() {
        return y_;
    }

    public void setX(double x_) {
        this.x_ = x_;
    }

    public void setY(double y_) {
        this.y_ = y_;
    }
}
